﻿using RAP.Framework.Libary.Utils;
using System.Collections;
using RAP.Framework.Libary.DomTemplateBuilder.Attributes;
using RAP.Framework.Libary.DomTemplateBuilder.Handler.Conditional;

namespace RAP.Framework.Libary.DomTemplateBuilder.Element.Conditional
{
	/// <summary>
	/// 是否包含指定的值
	/// </summary>
	[TagHandler( typeof( IsContainValuesHandler ) )]
    public class IsContainValues : CompareBase, IConditionalElement
    {
        private new IList _compareValue = null;

        /// <summary>
        /// 被比较的值集合
        /// </summary>
        public IList CompareValues
        {
            get
            {
				if ( this.CompareValue.IsNullOrEmpty ( ) )
                {
                    return null;
                }
                if ( _compareValue == null )
                {
                    _compareValue = new ArrayList ( this.CompareValue.Split ( ',' ) );
                }
                return _compareValue;
            }
        }
    }
}
